1. Field of the Invention
The present invention relates to a method, system, and program for maintaining a directory for data written to a storage medium.
2. Description of the Related Art
A host system writes data to tape in blocks of data referred to as logical blocks. The tape drive will package one or more logical blocks into one or more device blocks (also known as data sets) and write the device blocks sequentially to the tape medium. The data may be written in different patterns to the tape medium. On a helical scan tape, data is stored along vertical or diagonal tracks on the tape, on parallel tape data is stored on tracks in parallel during one scan on the tape, and on serpentine tape data is written in a forward and then reverse direction in a serpentine pattern across bands or tracks on the magnetic tape medium. A serpentine tape drive first read/writes a track in a forward direction within a section of a band, referred to as a wrap, then read/writes the next track in a reverse direction, and so on, leading to a serpentine pattern for the data layout. In tape technology, a wrap comprises one of the bands that extend the entire length of the tape and a wrap section comprises a section of the wrap.
The tape drive controller maintains a tape directory that provides information on the device blocks at specific physical locations on tape. The tape directory has entries corresponding to specific physical locations on the tape, where each entry indicates the device block number, file mark count, logical block, and other information on the data maintained at the physical location corresponding to the specific entry. In the event that the tape directory is corrupted, lost or is otherwise inaccessible, the tape drive controller must rebuild the entries in the tape directory.
This rebuild process is substantially time consuming because the tape drive controller must rewind the tape to the beginning and then read each device block to rebuild the tape directory entries before hosts may access the tape. As the densities, capacities, and lengths of tape media increases, the rebuild process needs to process an ever increasing amount of device blocks, thereby further increasing the time required to rebuild the tape directory.
For these reasons, there is a need in the art for improved techniques for managing tape directories and reducing the time and operations needed to rebuild the tape directory.